import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/home'
import UserAdd from '@/components/useradd'
import UserEdit from '@/components/useredit'
import Login from '@/components/login'
import Publish from '@/components/publish'
import Registered from '@/components/registered'

import Homeusers from '@/components/homeusers'
import HomeOutlines from '@/components/homeoutlines'
import Homemenus from '@/components/homemenus'
import HomeItems from '@/components/homeitems'
import HomePersonalCenter from '@/components/homepersonalcenter'
import HomePapers from '@/components/homepapers'
import PaperAdd from '@/components/paperadd'
import PaperEdit from '@/components/paperedit'
import Analysis from '@/components/analysis'

import HomeClasses from '@/components/homeclasses'

Vue.use(Router)
export default new Router({
  routes: [
    {
      path:'/',
      redirect:{
        name:'users'
      }
    },
    {
      path: '/home',
      name: 'home',
      redirect:{
        name:'users'
      },
      component: Home,
      children:[
        {
          path: 'users',
          name: 'users',
          component: Homeusers,
          
        },
        {
          path: 'useradd',
          name: 'useradd',
          component: UserAdd,
          
        },
        {
          path: 'useredit/:id',
          name: 'useredit',
          component: UserEdit,
          props:true
          
        },
        {
          path: 'menus',
          name: 'menus',
          component: Homemenus
        },
        {
          path: 'personalcenter',
          name: 'personalcenter',
          component: HomePersonalCenter
        },
        {
          path: 'outlines',
          name: 'outlines',
          component: HomeOutlines
        },
        {
          path: 'items',
          name: 'items',
          component: HomeItems
        },
        {
          path: 'papers',
          name: 'papers',
          component: HomePapers
        },
        {
          path: 'paperadd',
          name: 'paperadd',
          component: PaperAdd
        },
        {
          path: 'paperedit/:id',
          name: 'paperedit',
          component: PaperEdit,
          props:true
        },
        {
          path: 'analysis/:id',
          name: 'analysis',
          component:Analysis,
          props:true
        },
        {
          path: 'classes',
          name: 'classes',
          component: HomeClasses
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/publish/:id',
      name: 'publish',
      component: Publish,
      props:true
    },
    {
      path: '/registered',
      name: 'registered',
      component:Registered
    },
    
  ]
})
